package com.zzyweb.demomp.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.stereotype.Component;

import java.sql.Date;
import java.time.LocalDateTime;

/**
 * @author zhiyi
 * @date 9/9/25
 **/
@Component
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("t_user")
public class User {
    @TableId(value = "user_id", type = IdType.ASSIGN_ID)
    private Long userId;
    private String username;
    private String password;
    private String email;
    @TableField(exist = false)
    private Role role;
    //加入 tablelogic 注解后所有的查询都会在where 中加入 is_delete = 0
    @TableLogic
    private Integer isDelete;
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdDatetime;
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime updatedDatetime;

}
